<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="commonltr.css"/>
<title>Beeswax</title>
</head>
<body id="topic_4"><a name="topic_4"><!-- --></a>



  <h1 class="title topictitle1">Beeswax </h1>


  <div class="body conbody">
    <p class="p">The Beeswax application enables you to perform queries on Apache Hive, a
      data warehousing system designed to work with Hadoop. For information about Hive, see <a class="xref" href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-Installation-Guide/cdh5ig_hive_installation.html" target="_blank">Hive Documentation</a>. You can create Hive databases, tables and
      partitions, load data, create, run, and manage queries, and download the results in a
      Microsoft Office Excel worksheet file or a comma-separated values file. </p>

  </div>


<p>Thanks to HiveServer2 integration, Hue is getting the benefits from <a href="http://cloudera.com/content/cloudera/en/campaign/introducing-sentry.html">Sentry</a> (How to <a href="https://blogs.apache.org/sentry/entry/getting_started">configure Sentry Video</a>). In addition to the <a href="http://sentry.incubator.apache.org"><span>security</span></a> provided, Hue’s interface becomes more consistent. For example, a user without permissions on a database or table won’t see it in the query editor or in the <a href="http://gethue.com/category/metastore"><span>Metastore app</span></a>.</p>
<p><br/><span></span></p>
<p><span>HiveServer2 also provides performant access to the </span><a href="http://gethue.com/category/metastore"><span>Metastore</span></a><span>.</span></p>
<p><br/><span></span></p>
<p><span>On top of this, the Beeswax Hive UI is a Web editor for increasing the productivity:</span></p>

<ul><li>
<p><span>Syntax highlighting and auto completion</span></p>
</li>
<li>
<p><span>Submit several queries and check they progress later</span></p>
</li>
<li>
<p><a href="http://gethue.com/hadoop-tutorial-hive-udf-in-1-minute"><span>UDF</span></a><span> integration</span></p>
</li>
<li>
<p><span>Multiple queries execution</span></p>
</li>
<li>
<p><span>Select and send a fraction of a query</span></p>
</li>
<li>
<p><span>Download or save the query results</span></p>
</li>
<li>
<p><span>Navigate through the metadata</span></p>
</li>
</ul><p><br/><span></span></p>
<p><iframe frameborder="0" height="495" src="http://player.vimeo.com/video/79883574" width="900"></iframe></p>
<p><br/><span></span></p>
<h2><span>Hue 2.x</span></h2>
<p><span>We recommend to use at least Hue 2.5. Have Hue point to HiveServer2 by updating the Beeswax section in the </span><a href="https://github.com/cloudera/hue/blob/branch-2.5.1/desktop/conf.dist/hue.ini#L384"><span>hue.ini</span></a><span>:</span></p>
<p><br/><span></span></p>
<pre class="code">[beeswax]
  beeswax_server_host=&lt;FQDN of Beeswax server&gt;
  server_interface=hiveserver2
  beeswax_server_port=10000
</pre>
<p><br/><span></span></p>
<h2><span>Hue 3.x</span></h2>
<p><span>Hue 3 does not bundle Beeswaxd anymore, and is configured by default to use HiveServer2. If HiveServer2 is not on the same machine as Hue update </span><a href="https://github.com/cloudera/hue/blob/master/desktop/conf.dist/hue.ini#L438"><span>hue.ini</span></a><span> with:</span></p>
<p><br/><span></span></p>
<pre class="code">[beeswax]
 hive_server_host=&lt;FQDN of HiveServer2&gt;
</pre>
<p><span>Other Hive specific settings (e.g. security, impersonation) are read from a local </span><a href="https://github.com/cloudera/hue/blob/master/desktop/conf.dist/hue.ini#L450"><span>/etc/hive/conf/hive-site.xml</span></a><span>. We recommend to keep this one in exact sync with the original Hive one (or put Hue and Hive on the same machine).</span></p>
<p><span><strong><br/>Note</strong>:</span></p>
<p>If you are using Hive 0.12 or later, Hue needs to have <a href="https://issues.cloudera.org/browse/HUE-1561">HUE-1561</a> (or use Hue 3.0 or later).</p>
<h2><br/>With Sentry: Hue 2.x or 3.x</h2>
<p>Hue will automatically work with a HiveServer2 configured with Sentry.</p>
<p>Notice that HiveServer2 impersonation (described below) should be turned off in case of Sentry. Permissions of the impersonated user (e.g. ‘bob’) will be used instead of the ones of the ‘hue’ user. Also we need the warehouse permissions to be owned by hive:hive with 770 so that only super users in hive group can read, write.</p>
<p>HiveServer2 needs to be using strong authentication like Kerberos/LDAP for Sentry to work.</p>

<p><br/><span></span></p>
<h1><span>Troubleshooting without Sentry</span></h1>

<pre class="code">org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException Permission denied: user=hive, access=WRITE, inode="/user/test/data":test:supergroup:drwxr-xr-x
</pre>
<p><br/><span></span></p>
<p><span>By default HiveServer2 now owns the Hive warehouse (default ‘</span><span>/user/hive/warehouse</span><span>’), meaning the data files need to belong to the ‘hive’ user. If you get this error when creating a table, change the permission of the data directory (here </span><span>/user/test/data</span><span>) to ‘write’ for everybody or revert HiveServer2 to the old Beeswax behavior by authorizing ‘hive’ to impersonate the user. </span></p>
<p>Adding ‘hive’ as a Hadoop <a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Security-Guide/cdh4sg_topic_9_1.html?scroll=topic_9_1_3_unique_1__title_140_unique_1">proxy user</a> and edit your hive-site.xml:</p>
<pre class="code"> &lt;property&gt;
   &lt;name&gt;hive.server2.enable.doAs&lt;/name&gt;
   &lt;value&gt;true&lt;/value&gt;
 &lt;/property&gt;
</pre>
<p><span>Then restart HiveServer2:</span><span></span></p>
<pre class="code">sudo service hive-server2 restart
</pre>
<p><br/><span></span><br/><span></span></p>
<p><span>Another common error when using YARN is:</span></p>
<pre class="code">Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
</pre>
<p>It means that the HADOOP_MAPRED_HOME environment variable is not set to:</p>
<pre class="code">export HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce
</pre>
<p><span>HADOOP_HOME could also be wrong.</span></p>
<p><br/><span></span></p>
<pre class="code">TTransportException('Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found',)
</pre>
<p><span>Hue is missing a </span><a href="https://github.com/cloudera/hue#development-prerequisites"><span>SASL lib</span></a><span> in your system.</span></p>

<p><span>HiveServer2 supports 3 authentication modes specified by the &#8216;hive.server2.authentication&#8217; in hive-site.xml:</span></p>
<ul><li>
<p><span>NOSASL</span></p>
</li>
<li>
<p><span>NONE (default)</span></p>
</li>
<li>
<p><span>KERBEROS</span></p>
</li>
</ul><p><br/>Only NOSASL does not require SASL, so you either switch to it or install the missing packages.</p>
<p>Hue will pick the value from its local <a href="https://github.com/cloudera/hue/blob/master/desktop/conf.dist/hue.ini#L471">/etc/hive/conf/hive-site.xml</a> so make sure it is synced with the original hive-site.xml (manually or via CM Beeswax safety valve).</p>
<p><br/><span></span></p>
<pre class="code">Error while compiling statement: FAILED: RuntimeException org.apache.hadoop.security.AccessControlException: Permission denied: user=admin, access=WRITE, inode="/tmp/hive-hive":hive:hdfs:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:234) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:214) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:158)<br/></pre>
<p>The Hive HDFS workspace &#8216;/tmp/hive-hive&#8217; would need to be set to 1777 permissions.</p>

<p></p>
<h1>Troubleshooting with Sentry</h1>
<pre class="code">AuthorizationException: User 'hue/test.com' does not have privileges to execute 'CREATE' on: default.sample_08"
</pre>
<p>The user ‘hue’ is not configured in Sentry and have not the CREATE table permission. </p>

  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_4_1"><a name="topic_4_1"><!-- --></a>

    <h2 class="title topictitle2">Beeswax and Hive Installation and
      Configuration </h2>


    <div class="body conbody">

      <p class="p">Beeswax is installed and configured as part of Hue. <span class="ph">For information about installing and configuring Hue,
        see Hue Installation in <a class="xref" href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html" target="_blank">http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html</a>.</span>
      </p>


      <p class="p">Beeswax assumes an existing Hive installation. The Hue installation
        instructions include the configuration necessary for Beeswax to access Hive. You can view
        the current Hive configuration from the <strong class="ph b">Settings</strong> tab in
        the Beeswax application. </p>


      <p class="p">By default, a Beeswax user can see the saved queries for all users –
        both his/her own queries and those of other Beeswax users. To restrict viewing saved queries
        to the query owner and Hue administrators, set the <samp class="ph codeph">share_saved_queries</samp> property under the <samp class="ph codeph">[beeswax]</samp> section in the Hue configuration file to <samp class="ph codeph">false</samp>. </p>


    </div>


  </div>


  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_4_2"><a name="topic_4_2"><!-- --></a>

    <h2 class="title topictitle2">Starting Beeswax </h2>


    <div class="body conbody">

      <p class="p">Click the <strong class="ph b">Beeswax</strong> icon (<img class="image" src="/beeswax/static/art/icon_beeswax_24.png"/>)
        in the navigation bar at the top of the Hue browser page. </p>


    </div>


  </div>

  <div class="topic concept nested1" id="concept_xvg_nzh_dk"><a name="concept_xvg_nzh_dk"><!-- --></a>
    <h2 class="title topictitle2">Managing Databases, Tables, and Partitions</h2>

    <div class="body conbody">
      <p class="p" id="concept_xvg_nzh_dk__p_ygl_m13_dk"><a name="concept_xvg_nzh_dk__p_ygl_m13_dk"><!-- --></a>You can create databases, tables, partitions, and load data by executing
          <a class="xref" href="http://archive.cloudera.com/cdh4/cdh/4/hive/language_manual/data-manipulation-statements.html" target="_blank">Hive data manipulation
          statements</a> in the Beeswax application.</p>

      <p class="p" id="concept_xvg_nzh_dk__p_pdp_m13_dk"><a name="concept_xvg_nzh_dk__p_pdp_m13_dk"><!-- --></a>You can also use the <a class="xref" href="metastoremanager.html#xd_583c10bfdbd326ba-3ca24a24-13d80143249--7f9b">Metastore Manager</a> application to manage the
        databases, tables, and partitions and load data.</p>

    </div>

  </div>

  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_4_2_1"><a name="topic_4_2_1"><!-- --></a>
    <h2 class="title topictitle2">Installing Example Queries and
      Tables</h2>

    <div class="body conbody">
      <div class="note note" id="topic_4_2_1__note_sb1_dlk_2k"><a name="topic_4_2_1__note_sb1_dlk_2k"><!-- --></a><span class="notetitle"><img src="/static/desktop/art/help/note.jpg"/> 
      <b>Note</b>:</span> You must be a superuser to perform this task.</div>

      <a name="topic_4_2_1__ol_kss_btp_wj"><!-- --></a><ol class="ol" id="topic_4_2_1__ol_kss_btp_wj">
        <li class="li" id="topic_4_2_1__li_src_z3t_yj"><a name="topic_4_2_1__li_src_z3t_yj"><!-- --></a>Click <a name="topic_4_2_1__image_vv5_hnv_wj"><!-- --></a><img class="image" id="topic_4_2_1__image_vv5_hnv_wj" src="/static/desktop/art/hue-logo-mini.png"/>. The Quick Start Wizard opens.</li>

        <li class="li" id="topic_4_2_1__li_zgj_z3t_yj"><a name="topic_4_2_1__li_zgj_z3t_yj"><!-- --></a>Click <strong class="ph b">Step 2:
            Examples</strong>.</li>

        <li class="li">Click <strong class="ph b">Beeswax (Hive UI)</strong>.</li>

      </ol>

    </div>

  </div>


  <div class="topic concept nested1" xml:lang="en-US" lang="en-US" id="topic_4_3"><a name="topic_4_3"><!-- --></a>

    <h2 class="title topictitle2">Query Editor</h2>


    <div class="body conbody">

      <p class="p">The Query Editor view lets you create, save, and submit queries in the
          <a class="xref" href="http://wiki.apache.org/hadoop/Hive/LanguageManual" target="_blank">Hive Query Language (HQL)</a>,
        which is similar to Structured Query Language (SQL).  When you submit a query, the Beeswax
        Server uses Hive to run the queries. You can either wait for the query to complete, or
        return later to find the queries in the History view. You can also request to receive an
        email message after the query is completed.</p>

      <p class="p">In the box to the left of the Query field, you can select a database,
        override the default Hive and Hadoop settings, specify file resources and user-defined
        functions, enable users to enter parameters at run-time, and request email notification when
        the job is complete. See <a class="xref" href="#topic_4_3_2">Advanced Query Settings</a> for details on using these settings. </p>


    </div>


    <div class="topic concept nested2" xml:lang="en-US" lang="en-US" id="topic_4_3_1"><a name="topic_4_3_1"><!-- --></a>

      <h3 class="title topictitle3">Creating Queries </h3>


      <div class="body conbody">

        <ol class="ol">
          <li class="li" id="topic_4_3_1__li_v2d_p5k_xj"><a name="topic_4_3_1__li_v2d_p5k_xj"><!-- --></a>In the Query Editor window, type a query or
            multiple queries separated by a semicolon ";".  To be presented with a drop-down of
            autocomplete options, type <span class="ph uicontrol">CTRL+spacebar</span> when entering a query.  </li>

          <li class="li" id="topic_4_3_1__li_ilk_p5k_xj"><a name="topic_4_3_1__li_ilk_p5k_xj"><!-- --></a>To save your query and advanced settings to use
            again later, click <strong class="ph b">Save As</strong>, enter a name and
            description, and then click <strong class="ph b">OK</strong>. To save changes to an
            existing query, click <strong class="ph b">Save.</strong>
          </li>

          <li class="li">If you want to view the execution plan for the query, click <strong class="ph b">Explain</strong>. For more information, see <a class="xref" href="http://wiki.apache.org/hadoop/Hive/LanguageManual/Explain" target="_blank">http://wiki.apache.org/hadoop/Hive/LanguageManual/Explain</a>.</li>

        </ol>


      </div>


    </div>

    <div class="topic concept nested2" id="concept_ch1_5gb_zj"><a name="concept_ch1_5gb_zj"><!-- --></a>
      <h3 class="title topictitle3">Loading Queries into the Query Editor</h3>

      <div class="body conbody">
        <a name="concept_ch1_5gb_zj__ol_kkg_vgb_zj"><!-- --></a><ol class="ol" id="concept_ch1_5gb_zj__ol_kkg_vgb_zj">
          <li class="li">Do one of the following:<a name="concept_ch1_5gb_zj__ul_xlq_jqb_zj"><!-- --></a><ul class="ul" id="concept_ch1_5gb_zj__ul_xlq_jqb_zj">
              <li class="li">Click the <span class="ph uicontrol">My Queries</span>  tab.<a name="concept_ch1_5gb_zj__ol_qhz_lqb_zj"><!-- --></a><ol class="ol" type="a" id="concept_ch1_5gb_zj__ol_qhz_lqb_zj">
                  <li class="li">Click the <span class="ph uicontrol">Recent Saved Queries</span> or <span class="ph uicontrol">Recent Run
                      Queries</span> tab to display the respective queries. </li>

                </ol>
</li>

              <li class="li">Click the <span class="ph uicontrol">Saved Queries</span> tab.</li>

            </ul>
</li>

          <li class="li">Click a query name. The query is loaded into the Query Editor.</li>

        </ol>

      </div>

    </div>

    <div class="topic concept nested2" id="concept_xsr_yx1_zj"><a name="concept_xsr_yx1_zj"><!-- --></a>
      <h3 class="title topictitle3">Running Queries </h3>

      <div class="body conbody">
        <div class="note note" id="concept_xsr_yx1_zj__note_vbn_4xk_xj"><a name="concept_xsr_yx1_zj__note_vbn_4xk_xj"><!-- --></a><span class="notetitle"><img src="/static/desktop/art/help/note.jpg"/> 
      <b>Note</b>:</span> To run a query, you must be logged in to
          Hue as a user that also has a Unix user account on the remote server. </div>

        <a name="concept_xsr_yx1_zj__ol_rnw_yx1_zj"><!-- --></a><ol class="ol" id="concept_xsr_yx1_zj__ol_rnw_yx1_zj">
          <li class="li">To execute a portion of the query, highlight one or more query
            statements.</li>

          <li class="li">Click <strong class="ph b">Execute</strong>. The Query Results
            window appears with the results of your query. <a name="concept_xsr_yx1_zj__ul_f4w_yx1_zj"><!-- --></a><ul class="ul" id="concept_xsr_yx1_zj__ul_f4w_yx1_zj">
              <li class="li">To view a log of the query execution, click <strong class="ph b">Log</strong> at the top of the results display. You can use
                the information in this tab to debug your query.</li>

              <li class="li">To view the query that generated these results, click <strong class="ph b">Query</strong> at the top of the results display.</li>

              <li class="li">To view the columns of the query, click <strong class="ph b">Columns</strong>.</li>

              <li class="li">To return to the query in the Query Editor, click <strong class="ph b">Unsaved Query</strong>.</li>

            </ul>
</li>

          <li class="li">If there are multiple statements in the query, click <span class="ph uicontrol">Next</span> in
            the Multi-statement query pane to execute the remaining statements.</li>

        </ol>

        <div class="note note"><span class="notetitle"><img src="/static/desktop/art/help/note.jpg"/> 
      <b>Note</b>:</span> Under <strong class="ph b">MR JOBS</strong>, you can view any MapReduce jobs that
          the query generated.</div>

      </div>

    </div>

    <div class="topic concept nested2" id="concept_axp_mgb_zj"><a name="concept_axp_mgb_zj"><!-- --></a>
      <h3 class="title topictitle3">Downloading and Saving Query Results</h3>

      <div class="body conbody">
        <div class="note important"><span class="importanttitle"><img src="/static/desktop/art/help/important.jpg"/> 
      <b>Important</b>:</span>
          <a name="concept_axp_mgb_zj__ul_p4w_yx1_zj"><!-- --></a><ul class="ul" id="concept_axp_mgb_zj__ul_p4w_yx1_zj">
            <li class="li">You can only save results to a file when the results were
              generated by a MapReduce job.</li>

            <li class="li">This is the preferred way to save when the result is large (for
              example &gt; 1M rows).</li>

          </ul>

        </div>

        <a name="concept_axp_mgb_zj__ol_agb_4gb_zj"><!-- --></a><ol class="ol" id="concept_axp_mgb_zj__ol_agb_4gb_zj">
          <li class="li">Do any of the following to download or save the query results: <a name="concept_axp_mgb_zj__ul_i4w_yx1_zj"><!-- --></a><ul class="ul" id="concept_axp_mgb_zj__ul_i4w_yx1_zj">
              <li class="li">Click <strong class="ph b">Download as CSV</strong> to
                download the results in a comma-separated values file suitable for use in other
                applications.</li>

              <li class="li">Click <strong class="ph b">Download as XLS</strong> to
                download the results in a Microsoft Office Excel worksheet file.</li>

              <li class="li">Click <strong class="ph b">Save</strong> to save the
                results in a table or HDFS file.<a name="concept_axp_mgb_zj__ul_m4w_yx1_zj"><!-- --></a><ul class="ul" id="concept_axp_mgb_zj__ul_m4w_yx1_zj">
                  <li class="li">To save the results in a new table, select <strong class="ph b">In a new table</strong>, enter a table name, and then
                    click <strong class="ph b">Save</strong>.</li>

                  <li class="li">To save the results in an HDFS file, select <strong class="ph b">In an HDFS directory</strong>, enter a path and then
                    click <strong class="ph b">Save</strong>. You can then download the file
                    with <a class="xref" href="filebrowser.html#topic_6">File Browser</a>.  </li>

                </ul>
</li>

            </ul>
</li>

        </ol>

      </div>

    </div>


    <div class="topic concept nested2" xml:lang="en-US" lang="en-US" id="topic_4_3_2"><a name="topic_4_3_2"><!-- --></a>

      <h3 class="title topictitle3">Advanced Query Settings </h3>


      <div class="body conbody">

        <p class="p">The pane to the left of the Query Editor lets you specify the
          following options: </p>



<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" class="table" frame="hsides" border="1" rules="all">


            <thead class="thead" align="left">
              <tr class="row">
                <th class="entry" valign="top" width="16.666666666666664%" id="d5062e390">
                  <p class="p">
                    <strong class="ph b">Option</strong>
                  </p>

                </th>

                <th class="entry" valign="top" width="83.33333333333334%" id="d5062e399">
                  <p class="p">
                    <strong class="ph b">Description</strong>
                  </p>

                </th>

              </tr>

            </thead>

            <tbody class="tbody">
              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">DATABASE</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <p class="p">The database containing the table definitions. </p>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">SETTINGS</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <div class="p">Override the Hive and Hadoop default settings.  To configure
                    a new setting: <a name="topic_4_3_2__ol_k5v_hcc_zj"><!-- --></a><ol class="ol" id="topic_4_3_2__ol_k5v_hcc_zj">
                      <li class="li">Click <strong class="ph b">Add</strong>.</li>

                      <li class="li">For <strong class="ph b">Key</strong>, enter a Hive or Hadoop
                        configuration variable name. </li>

                      <li class="li">For <strong class="ph b">Value</strong>, enter the value you want to
                        use for the variable. </li>

                    </ol>
</div>

                  <p class="p">For example, to override the directory where structured
                    Hive query logs are created, you would enter <samp class="ph codeph">hive.querylog.location</samp> for <strong class="ph b">Key</strong>, and a path for <strong class="ph b">Value.</strong>
                  </p>

                  <p class="p">To view the default settings, click the <strong class="ph b">Settings</strong> tab at the top of the page. For
                    information about Hive configuration variables, see: <a class="xref" href="http://wiki.apache.org/hadoop/Hive/AdminManual/Configuration" target="_blank">http://wiki.apache.org/hadoop/Hive/AdminManual/Configuration</a>. For
                    information about Hadoop configuration variables, see: <a class="xref" href="http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml" target="_blank">http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml</a>.</p>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">FILE RESOURCES</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <div class="p">Make files locally accessible at query execution time
                    available on the Hadoop cluster. Hive uses the Hadoop Distributed Cache to
                    distribute the added files to all machines in the cluster at query execution
                      time.<a name="topic_4_3_2__ol_flf_vfc_zj"><!-- --></a><ol class="ol" id="topic_4_3_2__ol_flf_vfc_zj">
                      <li class="li">Click <strong class="ph b">Add</strong> to
                        configure a new setting.</li>

                      <li class="li">From the <strong class="ph b">Type</strong>
                        drop-down menu, choose one of the following:<a name="topic_4_3_2__ul_bkb_wfc_zj"><!-- --></a><ul class="ul" id="topic_4_3_2__ul_bkb_wfc_zj">
                          <li class="li">
                            <strong class="ph b">jar</strong> — Adds the specified resources to
                            the Java classpath.</li>

                          <li class="li"><strong class="ph b">archive</strong> —
                            Unarchives the specified resources when distributing them. </li>

                          <li class="li"><strong class="ph b">file</strong> — Adds the
                            specified resources to the distributed cache. Typically, this might be a
                            transform script (or similar) to be executed. </li>

                        </ul>
</li>

                      <li class="li">For <strong class="ph b">Path</strong>, enter the
                        path to the file or click <a name="topic_4_3_2__image_sdp_cgc_zj"><!-- --></a><img class="image" id="topic_4_3_2__image_sdp_cgc_zj" src="/static/desktop/art/help/browse.png"/> to browse and select the file.  </li>

                    </ol>
</div>


                  <div class="note note"><span class="notetitle"><img src="/static/desktop/art/help/note.jpg"/> 
      <b>Note</b>:</span> It is not necessary to specify files used in a
										transform script if the files are available in the same path
										on all machines in the Hadoop cluster.</div>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">USER-DEFINED FUNCTIONS</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <p class="p">Specify user-defined functions. Click <strong class="ph b">Add</strong> to configure a new setting. Specify the
                    function name in the <strong class="ph b">Name</strong> field, and specify
                    the class name for <strong class="ph b">Class</strong>
                    <strong class="ph b">name</strong>. </p>

                  <p class="p">You <em class="ph i">must</em> specify a JAR file for the user-defined
                    functions in <strong class="ph b"><strong class="ph b">FILE
                        RESOURCES</strong></strong>. </p>

                  <p class="p">To include a user-defined function in a query, add a $
                    (dollar sign) before the function name in the query. For example, if <var class="keyword varname">MyTable</var> is a user-defined
                    function name in the query, you would type: <samp class="ph codeph">SELECT * $</samp><samp class="ph codeph"><var class="keyword varname">MyTable</var></samp>
                  </p>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">PARAMETERIZATION</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <p class="p">Indicate that a dialog box should display to enter parameter
                    values when a query containing the string $<var class="keyword varname">parametername</var> is
                    executed. Enabled by default. </p>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="16.666666666666664%" headers="d5062e390 ">
                  <p class="p"><strong class="ph b">EMAIL NOTIFICATION</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="83.33333333333334%" headers="d5062e399 ">
                  <p class="p">Indicate that an email message should be sent after a query
                    completes. The email is sent to the email address specified in the logged-in
                    user's profile. </p>

                </td>

              </tr>

            </tbody>

          </table>
</div>


      </div>


    </div>


    <div class="topic concept nested2" xml:lang="en-US" lang="en-US" id="topic_4_3_3"><a name="topic_4_3_3"><!-- --></a>

      <h3 class="title topictitle3">Viewing Query History </h3>


      <div class="body conbody">

        <p class="p">You can view the history of queries that you have run previously.
          Results for these queries are available for one week or until Hue is restarted. </p>


        <ol class="ol">

          <li class="li">Click <strong class="ph b">History</strong>. A list of your
            saved and unsaved queries displays in the Query History window.</li>


          <li class="li">To display the queries for all users, click <strong class="ph b">Show everyone's queries</strong>.
						To display your queries only, click <strong class="ph b">Show my queries</strong>.</li>


          <li class="li">To display the automatically generated actions performed on a
            user's behalf, click <strong class="ph b">Show auto actions</strong>. To display
            user queries again, click <strong class="ph b">Show user queries</strong>.</li>


        </ol>


      </div>


    </div>


    <div class="topic concept nested2" xml:lang="en-US" lang="en-US" id="topic_4_3_4"><a name="topic_4_3_4"><!-- --></a>

      <h3 class="title topictitle3">Viewing, Editing, Copying, and Deleting
        Saved Queries </h3>


      <div class="body conbody">

        <p class="p">You can view a list of saved queries of all users by clicking <strong class="ph b">My
            Queries</strong> and then selecting either  <span class="ph uicontrol">Recent Saved Queries</span> or
            <span class="ph uicontrol">Recent Run Queries</span> tab to display the respective queries or
          clicking <strong class="ph b">Saved Queries</strong>. You can copy any query, but you
          can edit, delete, and view the history of only your own queries. </p>


<div class="tablenoborder"><a name="topic_4_3_4__table_rxy_gdh_b3"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="topic_4_3_4__table_rxy_gdh_b3" class="table" frame="hsides" border="1" rules="all">


            <thead class="thead" align="left">
              <tr class="row">
                <th class="entry" valign="top" width="25%" id="d5062e719">Saved Query</th>

                <th class="entry" valign="top" width="75%" id="d5062e722">Procedure</th>

              </tr>

            </thead>

            <tbody class="tbody">
              <tr class="row">
                <td class="entry" valign="top" width="25%" headers="d5062e719 ">
                  <p class="p">
                    <strong class="ph b">Edit</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="75%" headers="d5062e722 ">
                  <div class="p">
                    <a name="topic_4_3_4__ol_hbl_xbh_dk"><!-- --></a><ol class="ol" id="topic_4_3_4__ol_hbl_xbh_dk">
                      <li class="li">Click <strong class="ph b">Saved Queries</strong>.
                        The Queries window displays.</li>

                      <li class="li">Check the checkbox next to the query and click <strong class="ph b">Edit</strong>. The query displays in the Query
                        Editor window.</li>

                      <li class="li">Change the query and then click <strong class="ph b">Save.</strong> You can also click <strong class="ph b">Save As</strong>, enter a new name, and click <strong class="ph b">OK</strong> to save a copy of the query.</li>

                    </ol>

                  </div>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="25%" headers="d5062e719 ">
                  <p class="p">
                    <strong class="ph b">Copy</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="75%" headers="d5062e722 ">
                  <div class="p">
                    <a name="topic_4_3_4__ol_dqp_xbh_dk"><!-- --></a><ol class="ol" id="topic_4_3_4__ol_dqp_xbh_dk">
                      <li class="li">Click <strong class="ph b">Saved Queries</strong>.
                        The Queries window displays.</li>

                      <li class="li">Check the checkbox next to the query and click <strong class="ph b">Copy</strong>. The query displays in the Query
                        Editor window.</li>

                      <li class="li">Change the query as necessary and then click <strong class="ph b">Save.</strong> You can also click <strong class="ph b">Save As</strong>, enter a new name, and click <strong class="ph b">OK</strong> to save a copy of the query.</li>

                    </ol>

                  </div>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="25%" headers="d5062e719 ">
                  <p class="p">
                    <strong class="ph b">Copy in Query History</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="75%" headers="d5062e722 ">
                  <div class="p">
                    <a name="topic_4_3_4__ol_ut5_xbh_dk"><!-- --></a><ol class="ol" id="topic_4_3_4__ol_ut5_xbh_dk">
                      <li class="li">Click <strong class="ph b">History</strong>. The
                        Query History window displays.</li>

                      <li class="li">To display the queries for all users, click <strong class="ph b">Show everyone's queries</strong>. The queries for
                        all users display in the History window.</li>

                      <li class="li">Click the query you want to copy. A copy of the query
                        displays in the Query Editor window.</li>

                      <li class="li">Change the query, if necessary, and then click <strong class="ph b">Save As</strong>, enter a new name, and click <strong class="ph b">OK</strong> to save the query.</li>

                    </ol>

                  </div>

                </td>

              </tr>

              <tr class="row">
                <td class="entry" valign="top" width="25%" headers="d5062e719 ">
                  <p class="p">
                    <strong class="ph b">Delete</strong>
                  </p>

                </td>

                <td class="entry" valign="top" width="75%" headers="d5062e722 ">
                  <a name="topic_4_3_4__ol_fgh_1vc_zj"><!-- --></a><ol class="ol" id="topic_4_3_4__ol_fgh_1vc_zj">
                    <li class="li">Click <strong class="ph b">Saved Queries</strong>.
                      The Queries window displays.</li>

                    <li class="li">Check the checkbox next to the query and click <strong class="ph b">Delete</strong>.</li>

                    <li class="li">Click <strong class="ph b">Yes</strong> to confirm
                      the deletion.</li>

                  </ol>

                </td>

              </tr>

            </tbody>

          </table>
</div>


      </div>


    </div>


  </div>



</body>
</html>
